package com.yjymm.commonsdk.common.exception.en;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.ToString;

/**
 * @author yjymm
 * @date 2020-12-26 0:10
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@ToString
public enum CommonResultEnum implements BusinessEnum {

    OK(2000,"成功"),

    NO_AUTHORIITY(4001,"没有权限"),
    NO_LOGIN(4002,"未登陆"),

    ERROR(5000,"服务器错误"),
    MYSQL_ERROR(5003, "数据库错误"),

    /**
     * bingresult 参数传递错误
     */
    PARAMS_ERROR(5004, "参数传递错误");

    private Integer code;
    private String message;

    private CommonResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

}
